﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLua.LuaDLL.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace CSObjectWrap
{
    public class TestGenFloatStructClassWrap
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			Utils.BeginObjectRegister(typeof(TestGenFloatStructClass), L, translator, 0, 5, 5, 5);
			
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Add2", Add2);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Sub3", Sub3);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "Multiply4", Multiply4);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "All5", All5);
			Utils.RegisterFunc(L, Utils.METHOD_IDX, "All6", All6);
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "Struct2", get_Struct2);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "Struct3", get_Struct3);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "Struct4", get_Struct4);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "Struct5", get_Struct5);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "Struct6", get_Struct6);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "Struct2", set_Struct2);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "Struct3", set_Struct3);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "Struct4", set_Struct4);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "Struct5", set_Struct5);
            Utils.RegisterFunc(L, Utils.SETTER_IDX, "Struct6", set_Struct6);
            
			Utils.EndObjectRegister(typeof(TestGenFloatStructClass), L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(typeof(TestGenFloatStructClass), L, __CreateInstance, 1, 0, 0);
			
			
            
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "UnderlyingSystemType", typeof(TestGenFloatStructClass));
			
			
			Utils.EndClassRegister(typeof(TestGenFloatStructClass), L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			try {
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					TestGenFloatStructClass __cl_gen_ret = new TestGenFloatStructClass();
					translator.Push(L, __cl_gen_ret);
					return 1;
				}
				
			}
			catch(System.Exception __gen_e) {
				return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
			}
            return LuaAPI.luaL_error(L, "invalid arguments to TestGenFloatStructClass constructor!");
            
        }
        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int Add2(RealStatePtr L)
        {
            
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
            
            
            try {
                
                {
                    NoGen2FloatStruct x;translator.Get(L, 2, out x);
                    Gen2FloatStruct y;translator.Get(L, 3, out y);
                    
                    __cl_gen_to_be_invoked.Add2( ref x, ref y );
                    translator.Push(L, x);
                        translator.Update(L, 2, x);
                        
                    translator.PushGen2FloatStruct(L, y);
                        translator.UpdateGen2FloatStruct(L, 3, y);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int Sub3(RealStatePtr L)
        {
            
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
            
            
            try {
                
                {
                    NoGen3FloatStruct x;translator.Get(L, 2, out x);
                    Gen3FloatStruct y;translator.Get(L, 3, out y);
                    
                    __cl_gen_to_be_invoked.Sub3( ref x, ref y );
                    translator.Push(L, x);
                        translator.Update(L, 2, x);
                        
                    translator.PushGen3FloatStruct(L, y);
                        translator.UpdateGen3FloatStruct(L, 3, y);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int Multiply4(RealStatePtr L)
        {
            
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
            
            
            try {
                
                {
                    NoGen4FloatStruct x;translator.Get(L, 2, out x);
                    Gen4FloatStruct y;translator.Get(L, 3, out y);
                    
                    __cl_gen_to_be_invoked.Multiply4( ref x, ref y );
                    translator.Push(L, x);
                        translator.Update(L, 2, x);
                        
                    translator.PushGen4FloatStruct(L, y);
                        translator.UpdateGen4FloatStruct(L, 3, y);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int All5(RealStatePtr L)
        {
            
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
            
            
            try {
                
                {
                    NoGen5FloatStruct x;translator.Get(L, 2, out x);
                    Gen5FloatStruct y;translator.Get(L, 3, out y);
                    
                    __cl_gen_to_be_invoked.All5( ref x, ref y );
                    translator.Push(L, x);
                        translator.Update(L, 2, x);
                        
                    translator.PushGen5FloatStruct(L, y);
                        translator.UpdateGen5FloatStruct(L, 3, y);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int All6(RealStatePtr L)
        {
            
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
            
            
            try {
                
                {
                    NoGen6FloatStruct x;translator.Get(L, 2, out x);
                    Gen6FloatStruct y;translator.Get(L, 3, out y);
                    
                    __cl_gen_to_be_invoked.All6( ref x, ref y );
                    translator.Push(L, x);
                        translator.Update(L, 2, x);
                        
                    translator.PushGen6FloatStruct(L, y);
                        translator.UpdateGen6FloatStruct(L, 3, y);
                        
                    
                    
                    
                    return 2;
                }
                
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int get_Struct2(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                translator.PushGen2FloatStruct(L, __cl_gen_to_be_invoked.Struct2);
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int get_Struct3(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                translator.PushGen3FloatStruct(L, __cl_gen_to_be_invoked.Struct3);
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int get_Struct4(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                translator.PushGen4FloatStruct(L, __cl_gen_to_be_invoked.Struct4);
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int get_Struct5(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                translator.PushGen5FloatStruct(L, __cl_gen_to_be_invoked.Struct5);
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int get_Struct6(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                translator.PushGen6FloatStruct(L, __cl_gen_to_be_invoked.Struct6);
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int set_Struct2(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                Gen2FloatStruct __cl_gen_value;translator.Get(L, 2, out __cl_gen_value);
				__cl_gen_to_be_invoked.Struct2 = __cl_gen_value;
            
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int set_Struct3(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                Gen3FloatStruct __cl_gen_value;translator.Get(L, 2, out __cl_gen_value);
				__cl_gen_to_be_invoked.Struct3 = __cl_gen_value;
            
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int set_Struct4(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                Gen4FloatStruct __cl_gen_value;translator.Get(L, 2, out __cl_gen_value);
				__cl_gen_to_be_invoked.Struct4 = __cl_gen_value;
            
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int set_Struct5(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                Gen5FloatStruct __cl_gen_value;translator.Get(L, 2, out __cl_gen_value);
				__cl_gen_to_be_invoked.Struct5 = __cl_gen_value;
            
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 0;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int set_Struct6(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            try {
			
                TestGenFloatStructClass __cl_gen_to_be_invoked = (TestGenFloatStructClass)translator.FastGetCSObj(L, 1);
                Gen6FloatStruct __cl_gen_value;translator.Get(L, 2, out __cl_gen_value);
				__cl_gen_to_be_invoked.Struct6 = __cl_gen_value;
            
            } catch(System.Exception __gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
            }
            return 0;
        }
        
		
		
		
		
    }
}
